import moment from "moment";
export const chartOption = {
  title: {
    text: "执行曲线",
    x: "center",
    y: "top",
    textStyle: {
      color: "#fff",
      fontSize: 20
    },
    top: "10"
  },
  grid: [
    {
      top: '14%',
      right: '3%',
      bottom: '10%',
      left: '4%',
      height: '30%'
    },
    {
      top: '56%',
      right: '3%',
      bottom: '0',
      left: '4%',
      height: '30%'
    },
  ],
  legend: {
    data: [

      "实际曲线",
      "日前全省平均节点电价"
    ],
    textStyle: {
      color: '#fff'
    },
    top: '50',
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#6a7985'
      }
    }
  },
  axisPointer: {
    link: [
      {
        xAxisIndex: 'all'
      }
    ]
  },
  xAxis: [
    {
      show: true,
      type: "category",
      boundaryGap: false,
      gridIndex: 0,
      data: ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"],
      axisLine: {
        lineStyle: {
          color: "#fff"
        }
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: "rgba(255,255,255,0.1)",
          type: "dashed"
        }
      }
    },
    {
      show: true,
      gridIndex: 1,

      type: "category",
      boundaryGap: false,
      data: ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"],
      axisLine: {
        lineStyle: {
          color: "#fff"
        }
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: "rgba(255,255,255,0.1)",
          type: "dashed"
        }
      }
    },
  ],

  yAxis: [
    {
      name: "(kwh)",
      axisLine: {
        lineStyle: {
          color: "#fff"
        }
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.1)"
        }
      },
      gridIndex: 0,
    },
    {
      name: '厘/kWh',
      type: 'value',
      axisLine: {
        lineStyle: {
          color: "#fff"
        }
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.1)"
        }
      },
      nameTextStyle: {
        padding: [0, 10, 0, 0],

      },


      gridIndex: 1,
    }
  ],
  series: [
    {
      name: "预测曲线",
      type: "line",
      step: 'end',
      //smooth: true,
      symbol: "circle",
      yAxisIndex: 0,
      itemStyle: {
        color: '#61ddaa', //改变折线点的颜色
        lineStyle: {
          color: '#61ddaa', //改变折线颜色

        }
      },

      areaStyle: {
        color: {
          type: 'linear',
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [{
            offset: 0,
            color: 'rgba(97,221,170,0.3)'
          }, {
            offset: 1,
            color: 'rgba(97,221,170,0)'
          }],
          global: false
        }
      },
      zlevel: 1,
      data: [],

    },
    {
      name: "实际曲线",
      type: "line",
      smooth: true,
      symbol: "circle",
      color: '#409EFF', //改变折线点的颜色
      yAxisIndex: 0,
      lineStyle: {
        width: 2,
        color: '#409EFF' //改变折线颜色
      },
      areaStyle: {
        color: {
          type: 'linear',
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [{
            offset: 0,
            color: 'rgba(64,158,255,0.3)'
          }, {
            offset: 1,
            color: 'rgba(64,158,255,0)'
          }],
          global: false
        }
      },
      zlevel: 1,
      data: [],

    },
    {
      name: "日前全省平均节点电价",
      type: "line",
      smooth: true,
      symbol: "circle",
      yAxisIndex: 1,
      xAxisIndex: 1,
      itemStyle: {
        color: '#ff9f43',
        lineStyle: {
          color: '#ff9f43'
        }
      },

      data: []
    }

  ]
};